#include<stdio.h>
int main(void)
{
	int sum,i,a,b,c;
	sum = 0;
	for(i=100;i<=999;i++)
	{
		a=i%10;
		b=(i%100-a)/10;
		c=i/100;
		if(i==a*a*a+b*b*b+c*c*c)
		{
			sum = sum + i;
		}
		else
		{
			sum = sum;
		}
	}
	printf("%d",sum);
	return 0;
 }
